﻿<UserControl x:Class="Songhay.Silverlight.BiggestBox.Views.HeaderView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:m="clr-namespace:Songhay.Silverlight.BiggestBox.ViewModels">

    <UserControl.Resources>
        <m:HeaderViewModel x:Key="HeaderViewModelDataSource" d:IsDataSource="True"/>

        <Style x:Key="BorderStyle" TargetType="Border">
            <Setter Property="Background" Value="#4A708B" />
        </Style>
        <Style x:Key="HyperlinkHeader" TargetType="HyperlinkButton">
            <Setter Property="FontSize" Value="18" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Margin" Value="0,8,0,0" />
            <Setter Property="Width" Value="300" />
        </Style>
        <Style x:Key="TextBlockHeader" TargetType="TextBlock">
            <Setter Property="FontSize" Value="24" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Foreground" Value="Seashell" />
            <Setter Property="Padding" Value="12 12 0 0" />
        </Style>
        <Style x:Key="TextBlockHeaderBig" BasedOn="{StaticResource TextBlockHeader}" TargetType="TextBlock">
            <Setter Property="FontSize" Value="32" />
        </Style>
    </UserControl.Resources>
    <UserControl.DataContext>
        <Binding Mode="OneWay" Source="{StaticResource HeaderViewModelDataSource}"/>
    </UserControl.DataContext>
    <Border Style="{StaticResource BorderStyle}">
        <Grid Margin="0,0,0,24">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
            </Grid.RowDefinitions>

            <StackPanel  Grid.Column="0" Grid.Row="0">
                <TextBlock Style="{StaticResource TextBlockHeaderBig}" Text="{Binding Title}" />
                <TextBlock Style="{StaticResource TextBlockHeader}" Text="{Binding ServerNameUnc}" />
                <TextBlock Style="{StaticResource TextBlockHeader}" Text="{Binding WindowsIdentityDisplayLine}" />
            </StackPanel>

            <StackPanel Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="0,16,0,0">
                <HyperlinkButton
                    Command="{Binding HeaderCommand}"
                    CommandParameter="#about"
                    Content="About"
                    Style="{StaticResource HyperlinkHeader}" />
                <HyperlinkButton
                    Command="{Binding HeaderCommand}"
                    CommandParameter="/index"
                    Content="Index"
                    Style="{StaticResource HyperlinkHeader}" />
            </StackPanel>
        </Grid>
    </Border>
</UserControl>
